package com.gtw.modules.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.gtw.modules.entity.TbUser;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author wuye
 */
@Mapper
@Repository
public interface TbUserDao extends BaseMapper<TbUser> {

    int deleteByPrimaryKey(Long userId);

    @Override
    Integer insert(TbUser record);

    int insertSelective(TbUser record);

    TbUser selectByPrimaryKey(Long userId);

    int updateByPrimaryKeySelective(TbUser record);

    int updateByPrimaryKey(TbUser record);

    TbUser queryByMobile(String mobile);

    TbUser queryByUid(String value);

    TbUser queryWBBangd(String wbtoken, String wbopenid);

    TbUser queryQQBangd(String qqtoken, String qqopenid);

    List<TbUser> queryPageList(Page<TbUser> pageUtil, Map<String, Object> map);

    /**
     * 查询用户列表
     */
    List<TbUser> queryList(Map<String, Object> map);

    /**
     * 获取所有用户
     * @return
     */
    List<TbUser> queryAll();

    /**
     * 查看团队
     * @param userId
     * @return
     */
    List<TbUser> queryTeam(int userId);


    TbUser queryOpenId(String openid);

    List<TbUser> queryAllBySort();

    List<TbUser> queryAllBySort1();


    /*--------------------------------------------------------------------------------------------------------------------*/

    int foundByOne(Integer id);
    List<TbUser> queryByOnd(Map<String, Object> map);


    int foundByTwo(Integer id);
    List<TbUser> queryByTwo(Map<String, Object> map);

    int foundByThree(Integer id);
    List<TbUser> queryByThree(Map<String, Object> map);

    int foundByFour(Integer id);
    List<TbUser> queryByFour(Map<String, Object> map);


    List<TbUser> queryByintegrallevel1(Integer integrallevel);

    List<TbUser> queryenergyvaluelevel(Integer energyvaluelevel);

    List<TbUser> queryByParentId(Integer userid);

}